<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<!doctype html>
<html>

<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>会员登录</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css"
          type="text/css"/>
    <script src="${pageContext.request.contextPath}/js/jquery-1.11.3.min.js"
            type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"
            type="text/javascript"></script>
    <!-- 引入自定义css文件 style.css -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css" type="text/css"/>
    <style>
        body {
            margin-top: 20px;
            margin: 0 auto;
        }

        .carousel-inner .item img {
            width: 100%;
            height: 300px;
        }
    </style>
</head>

<body>

<jsp:include page="head.jsp"/>

<div class="container">
    <div class="row">

        <div style="margin:0 auto;margin-top:10px;width:950px;">
            <strong>订单详情</strong>
            <table class="table table-bordered">
                <tbody>
                <tr class="warning">
                    <th colspan="5">订单编号:${requestScope.order.oid} </th>
                </tr>
                <tr class="warning">
                    <th>图片</th>
                    <th>商品</th>
                    <th>价格</th>
                    <th>数量</th>
                    <th>小计</th>
                </tr>
                <c:forEach items="${requestScope.order.orderItems}" var="item">
                    <tr class="active">
                        <td width="60" width="40%">
                            <input type="hidden" name="id" value="22">
                            <img src="${pageContext.request.contextPath}/${item.product.image}" width="70"
                                 height="60">
                        </td>
                        <td width="30%">
                            <a target="_blank">${item.product.name}</a>
                        </td>
                        <td width="20%">
                            ￥${item.product.shopPrice}
                        </td>
                        <td width="10%">
                                ${item.count}
                        </td>
                        <td width="15%">
                            <span class="subtotal">￥${item.subTotal}</span>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>

        <div style="text-align:right;margin-right:120px;">
            商品金额: <strong style="color:#ff6600;">￥${requestScope.order.total}元</strong>
        </div>

    </div>

    <div>
        <hr/>
        <form class="form-horizontal">
            <div class="form-group">
                <label for="address" class="col-sm-4 control-label">地址</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="address" disabled="disabled"
                           value="${requestScope.shipping.shippingAddress}">
                </div>
            </div>
            <div class="form-group">
                <label for="consignee" class="col-sm-4 control-label">收货人</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="consignee" disabled="disabled"
                           value="${requestScope.shipping.shippingName}">
                </div>
            </div>
            <div class="form-group">
                <label for="telephone" class="col-sm-4 control-label">电话</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="telephone" disabled="disabled"
                           value="${requestScope.shipping.shippingTelephone}">
                </div>
            </div>
        </form>

        <hr/>
        <div style="margin-top:5px;margin-left:150px;">
            <strong>支付方式：</strong>
            <p>
                <br/>
                <input type="radio" name="pd_FrpId" value="CMBCHINA-NET-B2C"/>支付宝
                <img src="${pageContext.request.contextPath}/bank_img/pay.PNG" align="middle"/>
            </p>
            <hr/>
            <p style="text-align:right;margin-right:100px;">
                <a href="javascript:document.getElementById('orderForm').submit();" id="formPay">
                    <img src="${pageContext.request.contextPath}/images/finalbutton.gif" width="204"
                         height="51" border="0"/>
                </a>
            </p>
            <hr/>
            <form id="orderForm" name=alipayment
                  action="${pageContext.request.contextPath}/payJsp/alipay.trade.page.pay.jsp" method=post
                  target="_blank">
                <%--<dt>商户订单号 ：</dt>--%>
                <dd>
                    <input id="WIDout_trade_no" name="WIDout_trade_no" value="${requestScope.order.oid}"
                           type="hidden"/>
                </dd>

                <%--<dt>买家 ：</dt>--%>
                <dd>
                    <input id="WIDsubject" name="WIDsubject" value="${sessionScope.user.name}" type="hidden"/>
                </dd>

                <%--<dt>付款金额 ：</dt>--%>
                <dd>
                    <input id="WIDtotal_amount" name="WIDtotal_amount" value="${requestScope.order.total}"
                           type="hidden"/>
                </dd>
                <%--&lt;%&ndash;<dt>商品描述：</dt>&ndash;%&gt;--%>
                <%--<dd>--%>
                <input id="WIDbody" name="WIDbody" type="hidden"/>
            </form>
        </div>
    </div>

</div>

<jsp:include page="foot.jsp"/>

</body>
<script>
    $("#formPay").click(function () {
        $("#orderForm").submit();
//		$.ajax(
//			{
//				url:"/order/updateOrderState.do",
//				data:{
//				    oid:$("#WIDout_trade_no").val()
//				}
//                // success:function () {//通过jquery为action属性赋值
//
//                // }
//			}
//		)
    })
</script>
</html>